home *** CD-ROM | disk | FTP | other *** search
- #ifndef AVL_H
- #define AVL_H
-
- struct AVLNode /* Do not touch */
- {
- struct AVLNode *Left, *Right;
- struct AVLNode *Parent;
- int Balance;
- };
-
- struct AVLTree
- {
- struct AVLNode *Root;
- int (*CompareNodes) (struct AVLNode *, struct AVLNode *); /* see strcmp() */
- };
-
- struct AVLStateInfo
- {
- struct AVLNode *CurrentNode;
- struct AVLNode *FromNode;
- int GoRight;
- };
-
- /************************************************************************/
-
- struct AVLNode *AVL_InsertNode (struct AVLTree *, struct AVLNode *);
- struct AVLNode *AVL_SearchNode (struct AVLTree *, struct AVLNode *);
-
- void AVL_InitTraversal (struct AVLTree *, struct AVLStateInfo *);
- struct AVLNode *AVL_InOrder (struct AVLStateInfo *);
-
- #endif /* AVL_H */
-